<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>




<script src="../js/vue.js"></script>
<div id="app">
 <cpn></cpn>
  <cpn></cpn>
  <cpn></cpn>
</div>
<template id="cpn">
  <div>
    <h2>当前计数：{{count}}</h2>
    <button @click="increment">+</button>
    <button @click="decrement">-</button>
  </div>
</template>
<script>
  //1.注册全局组件
  Vue.component('cpn',{
    template:`#cpn`,
    data(){
      return {
        count:0
      }
    },
    methods:{
      increment() {
        this.count++
      },
      decrement() {
        this.count--
      }
    }
  })

  const app = new Vue({
    el: '#app',
    data: {
      message: "第一次，系统的学VUE"
    }
  })
</script>
</body>
</html>